
cc.Class({
    extends: cc.Component,

    properties: {
        rtTxt:cc.RichText,

        _data:null,
    },

    // use this for initialization
    onLoad: function () {
        if(this._data != null)
        {
            this.rtTxt.string = this._data.rtContent;
            var width = this.rtTxt._linesWidth.length>1 ? 830:this.rtTxt._linesWidth[0];
            var height = this.rtTxt._labelHeight;
            this.node.width += width;
            this.node.height = height+30;
 
            if(this.rtTxt._linesWidth.length > 1)
            {
                this.rtTxt.horizontalAlign = cc.TextAlignment.LEFT;
            }
            else
            {
                this.rtTxt.horizontalAlign = this._data.type;
            }
        }
    },


    //接收系统消息数据
    init:function(data){
        this._data = data;
    },

});
